package com.lzh.persevere.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lzh.persevere.model.entity.ArticleInfo;
import com.lzh.persevere.model.qo.qo.ArticlePageQO;
import com.lzh.persevere.model.ro.article.AddArticleRO;
import com.lzh.persevere.model.vo.article.ArticleDetailVO;
import com.lzh.persevere.model.vo.article.CategoryArticleVO;
import com.lzh.persevere.model.vo.tag.ArticleTagInfoVO;

import java.util.List;
import java.util.Map;


/**
 * 文章表服务接口
 *
 * @author luzhiheng
 * @since 2025-07-15
 */
public interface ArticleInfoService extends IService<ArticleInfo> {

    /**
     * 分页查询
     *
     * @param qo 查询参数
     * @return Map<String, Object>
     */
    Map<String, Object> pageList(ArticlePageQO qo);


    /**
     * 查询文章详情
     *
     * @param id 文章id
     * @return ArticleDetailVO
     */
    ArticleDetailVO findArticleDetail(Long id);

    /**
     * 查询所有分类文章列表
     *
     * @return List<CategoryArticleVO>
     */
    List<CategoryArticleVO> findAllCategoryArticleList();

    /**
     * 保存文章
     *
     * @param ro 保存参数
     * @return Boolean
     */
    Boolean addArticle(AddArticleRO ro);

    /**
     * 修改文章
     *
     * @param ro 修改参数
     * @return Boolean
     */
    Boolean editArticle(AddArticleRO ro);

    /**
     * 查询推荐文章
     *
     * @return List<ArticleInfo>
     */
    List<ArticleInfo> findRecommendArticle();

    /**
     * 点赞文章
     *
     * @param articleId 文章id
     * @return Boolean
     */
    Boolean likeArticle(Long articleId);

    /**
     * 收藏文章
     *
     * @param articleId 文章id
     * @return Boolean
     */
    Boolean collectArticle(Long articleId);

    /**
     * 查询文章标签列表根据分类ID
     *
     * @param categoryId 分类id
     * @return Boolean
     */
    List<ArticleTagInfoVO> findTagListByCategory(Long categoryId);
}

